package com.ycl.consul.web;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @RequestMapping("test01/{str}")
    public String go(@PathVariable String str) throws InterruptedException {

        if(str.equals("111")){
            Thread.sleep(10000);
        }else if(str.equals("222")){
            throw new RuntimeException("======运行时异常=======");
        }
        System.out.println("23423423++++++++="+str);
        return str;
    }



    @RequestMapping("test02")
    public String gfads(@PathVariable String str){
        return str;
    }




    /*@RequestMapping(method = RequestMethod.POST,value = "/test02/{str}")
    public String test02(@PathVariable("str") String str){

        return str;
    }*/
}
